﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;

namespace IHISCETeim.Web.MachineSys.UserModel
{
    public partial class USpecialCaseAdd : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.新增 };
            }
        }

        protected override string DWZRef
        {
            get { return "USpecialCaseList"; }
        }


        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "add")
            {
                addmenu();

            }
        }

        protected void addmenu()
        {
            USpecialCaseInfo obj = Request.SerializableObject<USpecialCaseInfo>();
            //// obj.UserType = 1;
            //obj.CardCode = GetRequestValue<string>("CardCodeTag", "C") + obj.CardCode;
            //obj.Creater = User.RealName;
            //obj.CreateDate = DateTime.Now;

            //if (USpecialCaseController.GetByCardCode(obj.CardCode) != null)
            //{
            //    AlertJson("已存在相应的合作伙伴编码,请重新输入");
            //    return;
            //}

            int r = USpecialCaseController.Add(obj);

            // this.AddLog(Permission.新增, null, obj);

            if (r > 0)
            {
                SuccessJson("添加成功", this.DWZRef);
            }
            else
            {
                ErrorJson("添加失败", this.DWZRef);
            }
        }
    }
}